<template>
  <div>
    <Return txt="行程记录" style="background: #eeeeee"></Return>
    <div class="time" @click="show = true">2020年8月</div>
    <div class="mouey">
      <div
        class="mouey1"
        v-for="(item, index) in 10"
        :key="index"
        @click="indexId = index"
        :class="{ bgred: index == indexId }"
      >
        {{ item }}
      </div>
    </div>
    <div class="title">地图概况</div>
    <div class="msg">
      <baidu-map
        class="map"
        :center="center"
        :scroll-wheel-zoom="true"
        :zoom="zoom"
        @ready="handler"
      ></baidu-map>
    </div>
    <div class="coll" @click="luxiantap(114.123611,22.537961)">
      <div class="coll1">7:40-8:00</div>
      <div class="coll2">深圳罗湖汽车站</div>
    </div>
    <div class="coll" @click="luxiantap(113.820643,22.629272)">
      <div class="coll1">8:00-8:20</div>
      <div class="coll2">深圳宝安机场</div>
    </div>
    <van-popup v-model="show" position="bottom">
      <van-datetime-picker
        v-model="currentDate"
        type="year-month"
        title="选择年月"
        :min-date="minDate"
        @cancel="show = false"
        @confirm="onCoshownfirm"
        :max-date="maxDate"
        :formatter="formatter"
      />
    </van-popup>
  </div>
</template>
<script>
import Return from "../../../components/return";
export default {
  components: {
    Return,
  },
  data() {
    return {
      minDate: new Date(2020, 0, 1),
      maxDate: new Date(2025, 10, 1),
      currentDate: new Date(),
      show: false,
      indexId: 1,
      center: { lng: 113.853769, lat: 22.600968 },
      zoom: 20,
    };
  },
  methods:{
    luxiantap(lng,lat){
this.center.lng=lng
this.center.lat=lat
    }
    
  }
};
</script>
<style scoped>
.time {
  margin: 20px 10%;
  width: 80%;
  height: 40px;
  background: #4ac7d7;
  line-height: 40px;
  text-align: center;
  border-radius: 5px;
  color: white;
}
.mouey {
  margin: 5px 5%;
  width: 90%;
  height: 40px;
  background: #16a5b6;
  text-align: center;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.mouey1 {
  width: 8.8%;
  border-left: 1px solid #cbcbcb;
  height: 40px;
  line-height: 40px;
}
.bgred {
  background: red;
}
.title {
  height: 30px;
  width: 97%;
  padding-left: 3%;
  background: #f2f2f2;
  font-size: 13px;
  color: #cecece;
  line-height: 30px;
}
.msg {
  width: 100%;
  height: 300px;
  text-align: center;
  line-height: 300px;
  border-bottom: 5px solid #eee;
}
.map {
  width: 100%;
  height: 300px;
}
.coll {
  height: 40px;
  width: 100%;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.coll1 {
  width: 40%;
}
.coll2 {
  width: 40%;
  color: #30ce7c;
}
</style>